package week07.midTest;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class PlaneFactory {
    private static Properties properties=new Properties();
    static {
        try {
            properties.load(new FileInputStream("src/week07/midTest/plane.properties"));
        }catch (IOException e){
            e.printStackTrace();
        }
    }
    public static  Plane getInstance(){
        Plane plane=null;
        try {
            plane= (Plane) Class.forName(properties.getProperty("plane1")).newInstance();
        }catch (Exception e)
        {
            e.printStackTrace();
        }
        return plane;
    }

}
